package com.ruoyi.web.controller.shop.mapper;

import com.ruoyi.common.core.dao.BaseMapper;
import com.ruoyi.common.entity.DO.product.ShopProductAttributeDO;
import com.ruoyi.common.entity.DO.product.ShopProductConfigDO;
import com.ruoyi.common.entity.VO.shop.ShopProductConfigVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface IBackShopProductConfigMapper extends BaseMapper<ShopProductConfigDO> {

    @Select("SELECT p.id,p.product_name productName,p.product_category productCategory,config_name configName,config_value configValue FROM shop_product_config sc " +
            " left join shop_product sp on sc.product_id=sp.product_id and sc.shop_id=sp.shop_id " +
            " left join product p on sp.product_id=p.id" +
            " WHERE p.system_module = 1 and sc.shop_id=#{shopId} and config_group=#{configGroup} and sc.is_enable=1 and sc.is_delete=0")
    List<ShopProductConfigVO> searchConfigList(@Param("shopId") Long shopId,@Param("configGroup") String configGroup);
}
